/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.feiyue.basic.reader.dialog;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import com.feiyue.basic.reader.adapter.PageSettingBgDialogAdapter;

public class PageSettingBgDialog extends Dialog implements
		View.OnClickListener, AdapterView.OnItemClickListener {
	public static final String RECEIVER = "com.worlds.reader.dialog.PageSettingBgDialog";
	private PageSettingBgDialogAdapter adapter;
	private Context context;
	private final LayoutInflater layoutInflater;
	private GridView mGridView;
	private int[] pages = { 2130837533, 2130837534, 2130837535, 2130837536 };
	private View view;

	public PageSettingBgDialog(Context paramContext, int paramInt) {
		super(paramContext, paramInt);
		this.context = paramContext;
		this.layoutInflater = ((LayoutInflater) this.context
				.getSystemService("layout_inflater"));
	}

	public void cancel() {
		super.cancel();
	}

	public void onClick(View paramView) {
	}

	protected void onCreate(Bundle paramBundle) {
		super.onCreate(paramBundle);
		setCanceledOnTouchOutside(true);
		this.view = this.layoutInflater.inflate(2130903065, null);
		setContentView(this.view);
		this.mGridView = ((GridView) this.view.findViewById(2131099840));
		this.mGridView.setSelector(new ColorDrawable(0));
		this.adapter = new PageSettingBgDialogAdapter(this.context, this.pages);
		this.mGridView.setAdapter(this.adapter);
		this.mGridView.setOnItemClickListener(this);
	}

	public void onItemClick(AdapterView<?> paramAdapterView, View paramView,
			int paramInt, long paramLong) {
		Intent localIntent = new Intent(
				"com.worlds.reader.dialog.PageSettingBgDialog");
		localIntent.putExtra("position", paramInt);
		this.context.sendBroadcast(localIntent);
		cancel();
	}
}